# Load model directly
from transformers import AutoModel, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("/model_path/chatglm2/chatglm6-32K")
model = AutoModel.from_pretrained("/model_path/chatglm2/chatglm6-32K")
print(model)
model = model.eval()
response, history = model.chat(tokenizer, "你好", history=[])
print(response)

response, history = model.chat(tokenizer, "晚上睡不着应该怎么办", history=history)
print(response)